{extend name="base"/}
{block name="title"}
<title>妙百睿国际幼儿园-入园登记表</title>
{/block}

{block name="content"}
<div class="g-hert" style="background: #f9f9f9;border-bottom: 1px solid #dfdfdf;margin-bottom: 0">
	<div class="container">
		<div class="row">
			<div class=" xuxian">
				<p class="x-left pull-left">特色活动 <span class="smalll"></span></p>
				<p class="x-right pull-right">首页 &nbsp;/&nbsp;特色活动</p>
			</div>
		    </div>
		</div>
</div>
<div class="container" style="margin-top: 25px;margin-bottom: 25px">
	<div class="row">
    <div class="col-md-12 x-b text-center">
	<p style="color: #834c92;font-weight: bold;">妙百睿国际幼儿园预约入园</p>
	<p style="color: #834c92">	幼儿信息登记表</p>
    </div>
</div>
</div>
<div class="form container-fluid">
	<h3>幼儿信息</h3>
	<div class="youer row">
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>幼儿姓名</p>
			<input class="givenName" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>性别</p>
			<label><input type="radio" value="men" name="a"/><span></span>男</label>
			<label><input type="radio" value="male" name="a"/><span></span>女</label>
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>出身年月</p>
			<input class="birthday" type="date" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>出生医学证明</p>
			<label><input type="radio" value="1" name="b"/><span></span>有</label>
			<label><input type="radio" value="0" name="b"/><span></span>无</label>

		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>预防接种证</p>
			<label><input type="radio" value="1" name="c"/><span></span>有</label>
			<label><input type="radio" value="0" name="c"/><span></span>无</label>
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>健康状况</p>
			<input class="healthStatus" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6">
			<p><img src="__HTML__/img/red.png"/>幼儿身份证号</p>
			<input class="birthCert" type="text" />

		</div>
		<div class="col-xs-12 col-sm-6">
			<p><img src="__HTML__/img/red.png"/>幼儿社会保险编号</p>
			<input class="socialSecurityNum"  type="text" />
		</div>
		<div class="col-xs-12 col-sm-6">
			<p><img src="__HTML__/img/red.png"/>性格特点</p>
			<textarea class="kidney"></textarea>
		</div>
		<div class="col-xs-12 col-sm-6">
			<p><img src="__HTML__/img/red.png"/>过敏史</p>
			<textarea class="allergicHistory"></textarea>
		</div>
	</div>
	<h3>家庭情况</h3>
	<div class="row">
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>固定电话</p>
			<input class="telephone" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>家长手机</p>
			<input class="parentPhone" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>房产证号</p>
			<input class="propertyCertificateNum" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>家庭住址</p>
			<input class="familyAddr" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>邮政编码</p>
			<input class="Postcode" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<p><img src="__HTML__/img/red.png"/>电子邮箱</p>
			<input class="electronicMessage" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6">
			<p><img src="__HTML__/img/red.png"/>户籍地</p>
			<input class="residence" type="text" />
		</div>
		<div class="col-xs-12 col-sm-6">
			<p><img src="__HTML__/img/red.png"/>邮政编码</p>
			<input class="residencePostcode" type="text" />
		</div>
	</div>
	<h3>家庭成员</h3>
	<div  class="table hidden-xs">
		<table class="familyMembers">
			<tr><th>成员关系</th><th>姓名</th><th>户籍地区</th><th>工作单位</th><th>身份证号</th></tr>
			<tr class="bl"><td><input class="familyRelation" type="text" /></td><td><input class="name" type="text" /></td><td><input class="addr" type="text" /></td><td><input class="workUnit"  type="text" /></td><td><input class="idNum" type="text" /></td></tr>
			<tr class="bl"><td><input class="familyRelation" type="text" /></td><td><input class="name" type="text" /></td><td><input class="addr" type="text" /></td><td><input class="workUnit"  type="text" /></td><td><input class="idNum" type="text" /></td></tr>
			<tr class="bl"><td><input class="familyRelation" type="text" /></td><td><input class="name" type="text" /></td><td><input class="addr" type="text" /></td><td><input class="workUnit"  type="text" /></td><td><input class="idNum" type="text" /></td></tr>
		</table>
	</div>
	<div class="col-md-12 visible-xs " style="margin-top: 20px;padding: 0 25px">
		<div class="panel-group" id="mypanel">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<div class="panel-title" style="overflow: hidden" >
						<a data-toggle="collapse" data-parent="mypanel" href="#item1" >
							<div class="pull-left">
								<span class="title">家庭成员1</span>
							</div>
							<div class="pull-right"><i class="glyphicon glyphicon-plus up"></i></div>
						</a>
					</div>
				</div>
				<div id="item1" class="panel-collapse collapse in">
					<div class="panel-body">
						<input placeholder="成员关系：" class="familyRelation" type="text" />
						<input placeholder="姓名：" class="name" type="text" />
						<input placeholder="地址：" class="addr" type="text" />
						<input placeholder="工作单位：" class="workUnit"  type="text"/>
						<input placeholder="身份证号：" class="idNum" type="text" />

					</div>
				</div>
			</div>
		</div>
		<div class="panel-group" id="mypane2">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<div class="panel-title" style="overflow: hidden" >
						<a data-toggle="collapse" data-parent="mypanel" href="#item2" >
							<div class="pull-left">
								<span class="title">家庭成员2</span>
							</div>
							<div class="pull-right"><i class="glyphicon glyphicon-plus up"></i></div>
						</a>
					</div>
				</div>
				<div id="item2" class="panel-collapse collapse ">
					<div class="panel-body">
						<input placeholder="成员关系：" class="familyRelation" type="text" />
						<input placeholder="姓名：" class="name" type="text" />
						<input placeholder="地址：" class="addr" type="text" />
						<input placeholder="工作单位：" class="workUnit"  type="text"/>
						<input placeholder="身份证号：" class="idNum" type="text" />

					</div>
				</div>
			</div>
		</div>
		<div class="panel-group" id="mypane3">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<div class="panel-title" style="overflow: hidden" >
						<a data-toggle="collapse" data-parent="mypanel" href="#item3" >
							<div class="pull-left">
								<span class="title">家庭成员3</span>
							</div>
							<div class="pull-right"><i class="glyphicon glyphicon-plus up"></i></div>
						</a>
					</div>
				</div>
				<div id="item3" class="panel-collapse collapse">
					<div class="panel-body">
						<input placeholder="成员关系：" class="familyRelation" type="text" />
						<input placeholder="姓名：" class="name" type="text" />
						<input placeholder="地址：" class="addr" type="text" />
						<input placeholder="工作单位：" class="workUnit"  type="text"/>
						<input placeholder="身份证号：" class="idNum" type="text" />
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="tijiao">
	<button class="_back">取消</button><button class="post-v">提交</button>
</div>
{/block}
{block name="js"}
<script>
	$(function(){
        $('._back').click(function(){
			window.location.href='../index.html'
		})
		$('.post-v').click(function(){
			var givenName=$('.givenName').val()
			var surname=$('.givenName').val()
			var gender=$("input[name='a']:checked").val()
			var birthday =$('.birthday').val()
			var birthCertificate=$("input[name='b']:checked").val()
			var immunizationRecord=$("input[name='c']:checked").val()
			var healthStatus=$('.healthStatus').val()
			var birthCert=$('.birthCert').val()
			var socialSecurityNum = $('.socialSecurityNum').val()
			var kidney = $('.kidney').val()
			var allergicHistory = $('.allergicHistory').val()
			var familyAddr = $('.familyAddr').val()
			var postcode = $('.postcode').val()
			var telephone = $('.telephone').val()
			var parentPhone = $('.parentPhone').val()
			var propertyCertificateNum = $('.propertyCertificateNum').val()
			var electronicMessage = $('.electronicMessage').val()
			var residence = $('.residence').val()
			var residencePostcode = $('.residencePostcode').val()
			var date = {
				"sourceCode":"webSite",
				"token":"5c8b0c20553b43afb7df944cb2f2f30c",
				"givenName":givenName,
				"surname":surname,
				"gender":gender,
				"birthday":birthday,
				"birthCertificate":birthCertificate,
				"immunizationRecord":immunizationRecord,
				"healthStatus":healthStatus,
				"birthCert":birthCert,
				"socialSecurityNum":socialSecurityNum,
				"kidney":kidney,
				"allergicHistory":allergicHistory,
				"familyAddr":familyAddr,
				"postcode":postcode,
				"telephone":telephone,
				"parentPhone":parentPhone,
				"propertyCertificateNum":propertyCertificateNum,
				"electronicMessage":electronicMessage,
				"residence":residence,
				"residencePostcode":residencePostcode,
				"familyMembers":[
					{"familyRelation":$('.familyRelation').eq(0).val(),"name":$('.name').eq(0).val(),"addr":$('.addr').eq(0).val(),"workUnit":$('.workUnit').eq(0).val(),"idNum":$('.idNum').eq(0).val()},
					{"familyRelation":$('.familyRelation').eq(1).val(),"name":$('.name').eq(1).val(),"addr":$('.addr').eq(1).val(),"workUnit":$('.workUnit').eq(1).val(),"idNum":$('.idNum').eq(1).val()},
					{"familyRelation":$('.familyRelation').eq(2).val(),"name":$('.name').eq(2).val(),"addr":$('.addr').eq(2).val(),"workUnit":$('.workUnit').eq(2).val(),"idNum":$('.idNum').eq(2).val()}
				]
			};
			$.ajax({
				type:'post',
				url:"http://118.178.252.68:8080/crm-web/v1/child/add?access-token=5c8b0c20553b43afb7df944cb2f2f30c",
				datatype:'json',
				contentType:'application/json',
				data:JSON.stringify(date),
				success: function(data){
					console.log(data);
					alert(1)

				},
				error:function(data){
					console.log(data);

				}
			});


		})

	})
</script>
{/block}